/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frct_detect_hash.h                                 */
/*  NOTE      = ct里保存协议识别内容的hash                         */
/*  DATE      = 2016/10/20 by guojq                                */
/*******************************************************************/

#ifndef __FRCT_DETECT_HASH_H_
#define __FRCT_DETECT_HASH_H_

#include "conntrack.h"

typedef struct __st_detect_hash {
    u_short ip_proto;
    void *p_detect_data;
} Frct_detect_hash;

Frhash_header* frct_detect_hash_init(unsigned int ui_table_size);
void frct_detect_hash_free(Frhash_header** pp_detect_hash);

int frct_detect_hash_key(u_short us_proto, char *p_key, unsigned int ui_key_size);
Frlist_node *frct_detect_hash_key_add(Conntrack *p_st_ct
                       , char *p_key, int i_key_len, u_short us_proto, void *p_detect_data);
Frlist_node *frct_detect_data_get_node(Conntrack *p_st_ct, u_short ip_proto);
int frct_detect_hash_del_node(Conntrack *p_st_ct, Frlist_node *p_st_node);

int frct_detect_hash_add(Conntrack *p_st_ct, u_short us_proto, void *p_detect_data);
void *frct_detect_data_get(Conntrack *p_st_ct, u_short ip_proto);
int frct_detect_hash_update(Conntrack *p_st_ct, u_short ip_proto, void *p_detect_data);
int frct_detect_hash_del(Conntrack *p_st_ct, u_short ip_proto);

#endif
